const KoaRouter = require("koa-router");
const {
  registerRepeat,
  bcryptPass,
  verifyLogin,
  verifyToken,
} = require("../middleware/user.middleware");
const { register, login, getUsers } = require("../controller/user.controller");
const router = new KoaRouter({ prefix: "/user" });

// 注册登录
router.post("/register", registerRepeat, bcryptPass, register);
router.post("/login", verifyLogin, login);

router.get("/", verifyToken, getUsers);
module.exports = router;
